import logging

from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from app.web.models.Database import get_db
from app.web.models.JobSeeker import JobSeeker
from app.web.models.Recruiter import Recruiter

logger = logging.getLogger(__name__)
router = APIRouter()


@router.get("/getCurrentUserInfo/{user_type}")
async def get_current_user_info(user_type: int, db: Session = Depends(get_db)):
    if user_type == 1:
        return db.query(Recruiter).first()
    elif user_type == 2:
        return db.query(JobSeeker).first()
    else:
        raise Exception("错误的用户类型")
